/**
 * Copyright 2014 xiaojian
 *
 *
 * Create on 2015年4月29日 下午3:44:35
 */
package xiaojian.toolkit.bean.xip.test;

import java.util.concurrent.BlockingQueue;

import org.apache.mina.core.session.IoSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import xiaojian.toolkit.transport.MutableEndpoint;

/**
 * @author <a href="mailto:caoxiaojian@wasu.cn">xiaojiancao</a>
 *
 */
public class DefaultEndpoint implements MutableEndpoint {
	
	private static final Logger logger = LoggerFactory.getLogger(DefaultEndpoint.class);
	
	private IoSession session = null;

	@Override
	public void stop() {
		
	}

	@Override
	public void send(Object bean) {
		if (this.session != null) {
			session.write(bean);
		} else {
			logger.warn("sesssion is null.");
		}
	}

	@Override
	public void messageReceived(IoSession session, Object msg) {
		logger.debug("Receive msg[{}].", msg);		
	}

	@Override
	public void start() {
		
	}

	@Override
	public void setIoSession(IoSession session) {
		this.session = session;
	}

	@Override
	public void setSharedSendQueue(BlockingQueue<Object> queue) {
		
	}
	

}
